/** * t_mnguser_info generation */var SUCCESS = 1;
$(function () {
    var defaults = {
        data_table: $("#data-result"),
        page_index: $("[name=page_index]"),
        role_form: $("#form1"),
        search_btn: $("#search_btn")
    };
    var settings = {domain: $("#domain").val(), staticdomain: $('#staticdomain').val(), tbody_msg: "#tbody-msg"};
    var path = {listdo_path: settings.domain + "/t_mnguser_info/listdo",};
    var t_mnguser_info = {
        init: function () {
            t_mnguser_info.listdo();
        }, listdo: function () {
            var url = path.listdo_path;
            $.post(url, defaults.role_form.serialize(), function (d) {
                defaults.data_table.html(d);
                try {
                    defaults.data_table[0].innerHTML = d;
                } catch (e) {
                    e.prototype;
                }
                $("#search_btn").attr("disabled", false);
            });
        }
    };
    /* 初始化加载*/
    t_mnguser_info.init();
    defaults.page_index.bind("click", function () {
        t_mnguser_info.listdo();
    });
    defaults.search_btn.bind("click", function () {
        $("#search_btn").attr("disabled", true);
        $("#page_index").val("1");
        t_mnguser_info.listdo();
    });
    $('.delBtn').live('click', function () {
        if (!window.confirm("是否确认操作？")) return;
        $.post(settings.domain + "/ajax/t_mnguser_info/del", {user_id: $(this).attr('data-id')}, function (resp) {
            if (resp.code == SUCCESS) {
                t_mnguser_info.listdo();
            } else {
                alert(resp.msg);
            }
        });
    });
});

function loadpage(index) {
    $("[name=page_index]").val(index);
    if ($("#pagesearchpagesize_loadpage").length > 0) {
        $("[name=page_size]").val($("#pagesearchpagesize_loadpage").val());
    }
    $("[name=page_index]").click();
}